<template>
  <div class="box">
    <v-chart :option="option()" autoresize></v-chart>
  </div>
</template>

<script lang="ts" setup>
const props = defineProps(["usersLastMonth", "usersLastDay"]);

const option = () => {
  return {
    xAxis: {
      show: false,
      max: props.usersLastDay,
      min: 0,
    },
    yAxis: {
      show: false,
      type: "category",
    },
    series: {
      type: "bar",
      data: [
        {
          value: props.usersLastMonth,
          itemStyle: {
            color: "orange",
          },
        },
      ],
      label: {
        show: true,
        position: "right",
        formatter: "|",
        color: "yellowgreen",
      },
      showBackground: true,
      barWidth: "15%",
    },
    grid: {
      left: 0,
      right: 0,
      bottom: 0,
      top: 0,
    },
  };
};
</script>

<style scoped>
.box {
  width: 100%;
  height: 100%;
}
</style>
